package com.example.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "goods", autoResultMap = true)
public class Goods extends Model<Goods> {
    /**
      * 主键
      */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
      * 商品名称
      */
    private String name;

    /**
      * 商品描述
      */
    private String description;

    /**
      * 商品编号
      */
    private String no;

    /**
      * 原价
      */
    private BigDecimal price;
    @TableField(exist = false)
    private BigDecimal realPrice;

    /**
      * 折扣
      */
    private Double discount;

    /**
      * 库存
      */
    private Integer store;

    /**
      * 点赞数
      */
    private Integer praise;

    /**
      * 销量
      */
    private Integer sales;

    /**
      * 分类id
      */
    private Long categoryId;
    @TableField(exist = false)
    private String categoryName;

    /**
      * 商品图片
      */
    private String imgs;

    /**
      * 创建时间
      */
//    private String createTime;

    private Boolean recommend;

    private Long createUserId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    /**
     * 状态
     */
    @TableField(fill = FieldFill.INSERT)
    private Integer status;

}
